package com.nchu.chatserver.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.nchu.chatserver.dao.MessageDTO;
import com.nchu.chatserver.entity.Message;
import com.nchu.chatserver.entity.User;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: 王小航
 * @Date: 2025/05/07/17:09
 * @Description:
 */
public interface MessageService extends IService<Message> {

    /**
     * 发送消息
     * @param messageDTO 消息传输对象
     */
    Message sendMessage(MessageDTO messageDTO);

    /**
     * 标记消息为已读
     * @param messageId 消息ID
     */
    void markAsRead(Integer messageId);

    void markMessagesAsRead(Integer userId, Integer contactId);
    /**
     * 获取用户未读消息
     * @param userId 用户ID
     * @return 未读消息列表
     */
    List<Message> getUnreadMessages(Integer userId);

    List<Message> getAllMessages(Integer userId,Integer contactId);

}